package com.zq;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ProjectName: ybxy6
 * @Titile: Student
 * @Author: zqsfg
 * @Description: TODO
 */
@Data
@AllArgsConstructor//全参构造函数
public class Student implements Comparable<Student> {
    private String name;
    private int age;

    @Override
    public int compareTo(Student o) {
        //按照学习的年龄的正序排序（）当前学生的年龄-被比较的学生的
        return this.getAge()-o.getAge();
    }
}
